package  
{
  import com.bit101.components.Label;
  import flash.display.Sprite;
  import flash.text.TextField;
  import flash.text.TextFieldAutoSize;
  import flash.xml.XMLDocument;
  import mge.Localization;
  import mge.LocString;
  import mge.Utils;
	/**
   * ...
   * @author ivan
   */    
  public class LocStringTest extends Sprite
  {
        
    private var loc:Localization;
    
    public function LocStringTest() 
    {
      loc = new Localization(onLocLoaded);
    }
    
    private const DEFAULT_LANGUAGE:String = "en";
    
    private function onLocLoaded():void
    {
        var text:String = loc.getText("DIALOG_ID_EXAMPLE").text;
        
        
        var tf:TextField = new TextField();
        tf.multiline = false;
        tf.autoSize = TextFieldAutoSize.LEFT;
        // text = Utils.removeBreakLines(text);
        // tf.htmlText = '<P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="12" COLOR="#ABABAB" LETTERSPACING="0" KERNING="0">Lorem <b>ipsum</b> dolor sit amet.</FONT></P>"'
        
        var xml:XML = loc.getLocalizationXML();
        var myXML:XMLDocument = new XMLDocument();
        myXML.ignoreWhite = true;
        myXML.parseXML(xml.toXMLString());
        // text = myXML.dialog.(@id == "DIALOG_ID_EXAMPLE")[DEFAULT_LANGUAGE];
        
        
        tf.htmlText = text;
        addChild(tf);
        
        //var words:localization_text = new localization_text();
        //trace (words.toString());
        /*
        for (var i:int = 0; i < words.length; i++)
        {
            trace(i + "- " + words[i]);
        }*/
    }
    
  }

}